unit uFrmInputQuery;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  Dialogs,
  StdCtrls,
  uCxtForm;

type
  TFrmInputQuery = class(TBaseForm)
    mmoInput: TMemo;
    lblPrompt: TLabel;
    btnOK: TButton;
    btnCancel: TButton;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

function InputQuery(const caption, prompt: string; var input: string): Boolean;

implementation

{$r *.dfm}

var
  FrmInputQuery: TFrmInputQuery;

function InputQuery(const caption, prompt: string; var input: string): Boolean;
begin
  if (FrmInputQuery = nil) then Application.CreateForm(TFrmInputQuery, FrmInputQuery);
  FrmInputQuery.Caption := caption;
  FrmInputQuery.lblPrompt.Caption := prompt;
  FrmInputQuery.mmoInput.Clear;
  Result := FrmInputQuery.ShowModal = mrOk;
  if (Result) then input := FrmInputQuery.mmoInput.Text;
end;

end.
